package com.d3works.apps.tool.module;

import com.d3works.app.D3worksModule;
import com.d3works.apps.tool.api.HttpExceptionHandler;
import com.d3works.apps.tool.api.HttpExceptionHandlerImpl;
import com.d3works.apps.tool.service.ArchivingToolService;
import com.d3works.apps.tool.service.ArchivingToolServiceImpl;
import com.d3works.apps.tool.service.CipherService;
import com.d3works.apps.tool.service.CipherServiceImpl;
import com.d3works.apps.tool.service.ConvertBinaryToMetafileService;
import com.d3works.apps.tool.service.ConvertBinaryToMetafileServiceImpl;
import com.d3works.apps.tool.service.ListToolService;
import com.d3works.apps.tool.service.ListToolServiceImpl;
import com.d3works.apps.tool.service.TranslationService;
import com.d3works.apps.tool.service.TranslationServiceImpl;
import com.google.inject.matcher.Matchers;

public class ToolModule extends D3worksModule {

  @Override
  protected void configure() {
    bind(CipherService.class).to(CipherServiceImpl.class);
    bind(TranslationService.class).to(TranslationServiceImpl.class);
    bind(ArchivingToolService.class).to(ArchivingToolServiceImpl.class);
    bind(ListToolService.class).to(ListToolServiceImpl.class);
    bind(ConvertBinaryToMetafileService.class).to(ConvertBinaryToMetafileServiceImpl.class);
    bindInterceptor(
        Matchers.any(),
        Matchers.annotatedWith(HttpExceptionHandler.class),
        new HttpExceptionHandlerImpl());
  }
}
